package org.gntc.prayer;

import org.gntc.prayer.database.PrayerDB;


import android.app.Activity;
import android.content.Intent;
import android.database.sqlite.SQLiteException;
import android.os.Bundle;

import android.widget.TextView;

public class ViewPrayerActivity extends Activity
{
	private PrayerDB mPrayerDB;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) 
	{
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.view_prayer_layout);
	    
	    TextView tv = (TextView)findViewById(R.id.testaaa);
	    
	    TextView input_title = (TextView)findViewById(R.id.input_title);
	    TextView input_title_view = (TextView)findViewById(R.id.input_title_view);
	    TextView category = (TextView)findViewById(R.id.input_category);
	    TextView category_view = (TextView)findViewById(R.id.input_category_view);
	    TextView period_from = (TextView)findViewById(R.id.input_period_from);
	    TextView period_from_view = (TextView)findViewById(R.id.input_period_from_view);
	    TextView period_to = (TextView)findViewById(R.id.input_period_to);
	    TextView period_to_view = (TextView)findViewById(R.id.input_period_to_view);
	    
	    initDB();
	    
	    Intent intent = getIntent();
	    int test = intent.getIntExtra("id", 0);
  
	    tv.setText("Extra " + test);
	    
	    input_title.setText("input_title");
	    input_title_view.setText("1");
	    category.setText("category");
	    category_view.setText("2");
	    period_from.setText("period_from");
	    period_from_view.setText("3");
	    period_to.setText("period_to");
	    period_to_view.setText("4");
	    
	}
	
	private void initDB() 
	{
		mPrayerDB = new PrayerDB(ViewPrayerActivity.this);
		try 
		{
			mPrayerDB.open();
		} 
		catch (SQLiteException e) 
		{
			e.printStackTrace();
		}
	}
	
	private void readViewDB()
	{
		
	}

}
